<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class TestValidate extends Validate
{
    protected $rule = [
        'id'            => 'require|number',
        'name'          => 'require',
        'introduction'  => 'require',
        'detail'        => 'require',
    ];
    protected $message = [
        'id.require'           => 'id不能为空',
        'id.number'            => 'id必须为数字',
        'name.require'         => '名称不能为空',
        'introduction.require' => '简介不能为空',
        'detail.require'       => '详情不能为空',
    ];

    protected $scene = [
        'add'  => ['name','introducton','detail'],
        'edit' => ['id','name','introducton','detail'],
    ];
}